// 引入封装好的get方法
import {get,post} from "./index";

// 这是首页头部一级导航分类
export const getcate = ()=>get("/getcate");

// 获取轮播图
export const getbanner = ()=>get("/getbanner");

// 获取三个tab
export const gethortgoods =()=>get("/gethortgoods");

// 获取商品全部分类信息 
export const getcates=()=>get('/getcates')

//获取二级分类下的所有商品 
export const getgoodlist = params =>get("/getgoodlist",params);

// 获取一个商品信息
export const getgoodsinfo=params =>get("/getgoodsinfo",params);

// 注册页
export const goregister =data=>post('/register',data);

// 登录页
export const gologin =data=>post('/login',data);

// 购物车列表 
export const getcartlist =params=>get("/cartlist",params);

// 购物车添加
export const cartadd = data=>post('/cartadd',data);

// 购物车修改-增加或减少
export const cartedit = data=>post('/cartedit',data);

// 购物车删除
export const cartdelete = data=>post('/cartdelete',data);

// 订单生成
export const orderadd  = data=>post('/orderadd',data);

// 地址查询
export const addresslist = params=>get("/addresslist",params);

//地址添加
export const addressadd = data =>post('/addressadd',data);

// 地址编辑
export const addressedit = data=>post('/addressedit',data);

// 地址删除
export const addressremove = data=>post("/addressremove",data);